import { musicRequest } from './request'

// 获取歌单
export function getSongSheet() {
  return musicRequest({
    method: 'get',
    url: '/top/playlist?limit=12&order=hot&cat=%E6%B5%81%E8%A1%8C',
  })
}

// 获取歌单歌曲
// /playlist/detail/dynamic?id=24381616
export function getSheetSongs(id) {
  return musicRequest({
    method: 'get',
    url: `/playlist/detail/dynamic?id=${id}`,
  })
}

// 获取音乐详情
export function getSongsDetail(id) {
  return musicRequest({
    method: 'get',
    url: `/song/detail?ids=${id}`,
  })
}

// 获取音乐地址
export function getSongsUrl(id) {
  return musicRequest({
    method: 'get',
    url: `/song/url?id=${id}`,
  })
}

// 搜索歌曲
export function searchSongs(keyword) {
  return musicRequest({
    method: 'get',
    url: `/search?keywords=${keyword}`,
  })
}
